# 初始镜像
FROM python:3.9
# FROM ningbo_court:v1
# 作者信息
MAINTAINER hrwang
# 创建并指定工作目录
RUN mkdir /root/rag
WORKDIR /root/rag
# 将当前目录复制到容器中
COPY . .
# 更改apt-get镜像源
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak
ADD sources.list /etc/apt
RUN chmod 777 /tmp
RUN apt-get update && apt-get install -y vim
RUN pip install --upgrade pip -i https://pypi.mirrors.ustc.edu.cn/simple/
RUN pip install -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple/
# 环境变量硬编码及时区
ENV TZ=Asia/Shanghai
ENV LANG zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
# 指定暴露端口

# 启动接口
RUN chmod +7 run_service.sh

# change shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# 权限不足时打开
USER root


#ENTRYPOINT ["./run_service.sh"]